home *** CD-ROM | disk | FTP | other *** search
- class EfficientTrailManager extends TrailManager
- {
- var endTransform;
- var trailClips;
- var mc;
- var trailNumber;
- var number = 10;
- var fade = true;
- var rotType = 0;
- function EfficientTrailManager(parent, target, trailNumber, color, number, fade, endTransform, rotType)
- {
- super(parent,target,trailNumber,color);
- if(number != null)
- {
- this.number = number;
- }
- if(fade != null)
- {
- this.fade = fade;
- }
- if(rotType != null)
- {
- this.rotType = rotType;
- }
- this.endTransform = endTransform;
- this.trailClips = new Array();
- var _loc3_ = this.getCoords();
- this.trailClips.push(this.mc.attachMovie("trail" + trailNumber,"t" + this.mc.getNextHighestDepth(),this.mc.getNextHighestDepth(),{x:_loc3_.x,y:_loc3_.y,cacheAsBitmap:true,_rotation:this.rotType}));
- }
- function makeTrail()
- {
- var _loc3_ = this.getCoords();
- if(this.trailClips.length < this.number)
- {
- this.trailClips.push(this.createNewTrail());
- }
- var _loc2_ = this.trailClips.length - 1;
- while(_loc2_ > 0)
- {
- this.trailClips[_loc2_]._x = this.trailClips[_loc2_ - 1]._x;
- this.trailClips[_loc2_]._y = this.trailClips[_loc2_ - 1]._y;
- _loc2_ = _loc2_ - 1;
- }
- this.trailClips[0]._x = _loc3_.x;
- this.trailClips[0]._y = _loc3_.y;
- }
- function createNewTrail()
- {
- var _loc3_ = this.trailClips[this.trailClips.length - 1];
- var _loc2_ = new Object();
- if(this.fade)
- {
- _loc2_._alpha = 100 - (this.trailClips.length - 1) * (100 / this.number);
- }
- if(this.endTransform != null)
- {
- var _loc4_ = 100 - this.endTransform;
- _loc2_._xscale = (this.endTransform - 100) / this.number * (this.trailClips.length - 1) + 100;
- _loc2_._yscale = _loc2_._xscale;
- }
- _loc2_._rotation = this.rotType;
- _loc2_.cacheAsBitmap = true;
- return this.mc.attachMovie("trail" + this.trailNumber,"t" + this.mc.getNextHighestDepth(),this.mc.getNextHighestDepth(),_loc2_);
- }
- function die()
- {
- this.mc.removeMovieClip();
- }
- }
-